﻿using Basic.UserModel.DB;
using Basic.UserModel.LoginLog;
using LinqKit;
using WeDonekRpc.Client;
using WeDonekRpc.Helper.IdGenerator;
using WeDonekRpc.SqlSugar;

namespace Basic.UserRepository.lmpl
{
    internal class LoginLogRepository : UserBaseRepository<DBLoginLog, long>, ILoginLogRepository
    {
        public LoginLogRepository (ISqlClientFactory factory) : base(factory)
        {
        }

        public void Adds (LoginLogAdd[] log)
        {
            DBLoginLog[] adds = log.ConvertMap<LoginLogAdd, DBLoginLog>();
            adds.ForEach(c =>
            {
                c.Id = IdentityHelper.CreateId();
            });
            base.Insert(adds);
        }
    }
}
